package com.cloudfun.campusshare.common.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import javax.validation.groups.Default;
import java.util.List;

/**
 * Created by Huqin on 2020/5/7
 */
@Data
@ApiModel(value = "角色创建DTO")
@Accessors(chain = true)
public class RoleCreateDTO {

    @ApiModelProperty("角色名称")
    @NotEmpty(message = "角色名称不能为空", groups = Create.class)
    @Length(min = 2, max = 12, message = "角色名称限制2-12个字符")
    private String name;

    @ApiModelProperty("角色描述")
    @NotEmpty(message = "角色描述不能为空", groups = Create.class)
    @Length(max = 40, message = "角色描述限制40个字符")
    private String description;

    @ApiModelProperty("权限集合")
    @Size(min = 1)
    private List<String> authorityIds;

    @ApiModelProperty("可分配角色集合")
    private List<String> slaveRoleIds;

    @ApiModelProperty("是否能查看所有数据")
    private Boolean viewAllData = false;

    @ApiModelProperty("角色类型")
    private String roleType;

    public static interface Create extends Default {
    }

}
